package com.bsoft.exchange.webservice.impl;

import java.util.List;

import javax.jws.WebService;

import org.dozer.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.bsoft.exchange.domain.DeptAndDoctorDomain;
import com.bsoft.exchange.response.ResponseEntity;
import com.bsoft.exchange.service.AppointmentService;
import com.bsoft.exchange.webservice.AppointmentWebService;

@WebService(serviceName="AppointmentService",//对外发布的服务名
                     targetNamespace="http://webservice.exchange.bsoft.com",//指定你想要的名称空间，通常使用使用包名反转
                     endpointInterface="com.bsoft.exchange.webservice.AppointmentWebService")//服务接口全路径, 指定做SEI（Service EndPoint Interface）服务端点接口
 @Component
public class AppointmentWebServiceImpl implements AppointmentWebService {
	
	@Autowired
    Mapper dozerMapper;
	
	@Autowired
	AppointmentService appointmentService;
	
	@Override
	public ResponseEntity<String> appointmentPay(
			String hospitalCode,
			String hisOrderNumber,
			String outOrderNumber,
			String payMode,
			String agtOrderNumber,
			Double payAmount,
			String payTime,
			String notify,
			String channelOrderNumber,
			Integer outpatientType
			) {
		
		ResponseEntity<String> entry = new ResponseEntity();

//		String notifyRet = appointmentService.appointmentPay(  
//			hospitalCode,
//			hisOrderNumber,
//			outOrderNumber,
//			payMode,
//			agtOrderNumber,
//			payAmount,
//			payTime,
//			notify,
//			channelOrderNumber,
//			outpatientType);
//		
//		
//		
//			entry.setData(notifyRet);


		return entry;

	}
	
	@Override
	public ResponseEntity<List<DeptAndDoctorDomain>> queryDeptAndDoctor(
			String hospitalCode,
			String query,
			Integer outpatientType
			) {
		
		ResponseEntity<List<DeptAndDoctorDomain>> entry = new ResponseEntity();

		List<DeptAndDoctorDomain> deptAndDoctorList = appointmentService.queryDeptAndDoctor(  
			hospitalCode,
			query,
			outpatientType);
		
		entry.setData(deptAndDoctorList);

		return entry;

	}
}
